// main.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。


#include <iostream>
#include <curl/curl.h>
#include <string>
#include "../include/INFLU_CONN.h"
using namespace std;
int main()
{
	const char* ip_str = "*****";
	const char* port = "8086";
	const char* username = "root";
	const char* password = "123456";
	//初始化连接
	INFLU_CONN* conn = new INFLU_CONN(ip_str, port, username, password, true);
	//建立连接
	conn->make_conn();
	conn->do_sql("show databases;");
	auto res1 = conn->do_sql("select \"salary\" from test", "myd");
	conn->do_sql("show measurements", "myd");
	
	cout << "res1--->" << res1;
	//cout<< *conn->fetchAll() << endl;
	//断开连接，如果要保持长连接，请不要调用
	conn->destroy_conn();
	if (!conn) delete conn;
	return 0;
}
